import 'package:flutter/material.dart';
import 'package:keep_account_web/utils/screen_utils.dart';

class MonthlyWorkRecordTitle extends StatelessWidget {

  final DeviceScreenType screenType;

  final int monthlyWorkDays;
  final double monthlyTotalProduct;
  final double monthlyTotalSingleProduct;
  final double monthlyTotalSalary;

  final double yearTotalProduct;
  final double yearTotalSingleProduct;
  final double yearTotalSalary;

  /*
   本月工作天数   本月产品总件数(个人件数)   本月总工资
   本年度总件数    本年度个人总件数        本年度总工资
   */

  const MonthlyWorkRecordTitle({
    super.key,
    required this.screenType,
    required this.monthlyWorkDays,
    required this.monthlyTotalProduct,
    required this.monthlyTotalSingleProduct,
    required this.monthlyTotalSalary,
    required this.yearTotalProduct,
    required this.yearTotalSingleProduct,
    required this.yearTotalSalary
  });

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.center,
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        Container(
          padding: EdgeInsets.only(top: 5.getScaleUpWidth(screenType),bottom: 5.getScaleUpWidth(screenType)),
          width: double.infinity,
          margin: EdgeInsets.only(bottom: 10.getScaleDownWidth(screenType)),
          decoration: BoxDecoration(
              color: Theme.of(context).colorScheme.onBackground,
              borderRadius: BorderRadius.circular(10)
          ),
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: [
              Column(
                crossAxisAlignment: CrossAxisAlignment.center,
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  SelectableText("$monthlyWorkDays",style: Theme.of(context).textTheme.bodyLarge,),
                  Text("本月总工数",style: Theme.of(context).textTheme.titleSmall,)
                ],
              ),
              Column(
                crossAxisAlignment: CrossAxisAlignment.center,
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  SelectableText("$monthlyTotalProduct",style:Theme.of(context).textTheme.bodyLarge,),
                  Text("本月产品总件数",style: Theme.of(context).textTheme.titleSmall,),
                  Visibility(
                      visible: monthlyTotalSingleProduct > 0,
                      maintainAnimation: false,
                      maintainSize: false,
                      maintainState: false,
                      child: SelectableText("含个人件$monthlyTotalSingleProduct件",style: Theme.of(context).textTheme.headlineSmall,)
                  )
                ],
              ),
              Column(
                crossAxisAlignment: CrossAxisAlignment.center,
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  SelectableText("$monthlyTotalSalary",style: Theme.of(context).textTheme.bodyLarge,),
                  Text("本月总工资",style: Theme.of(context).textTheme.titleSmall,)
                ],
              )
            ],
          ),
        ),
        Container(
          padding: EdgeInsets.only(top: 5.getScaleUpWidth(screenType),bottom: 5.getScaleUpWidth(screenType)),
          width: double.infinity,
          margin: EdgeInsets.only(top: 10.getScaleDownWidth(screenType)),
          decoration: BoxDecoration(
              color: Theme.of(context).colorScheme.onBackground,
              borderRadius: BorderRadius.circular(10)
          ),
          child: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: [
            Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                SelectableText("$yearTotalProduct",style: Theme.of(context).textTheme.bodyLarge,),
                Text("本年度总件数",style: Theme.of(context).textTheme.titleSmall,)
              ],
            ),
            Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                SelectableText("$yearTotalSingleProduct",style:Theme.of(context).textTheme.bodyLarge,),
                Text("本年度个人总件数",style: Theme.of(context).textTheme.titleSmall,),
              ],
            ),
            Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                SelectableText("$yearTotalSalary",style:Theme.of(context).textTheme.bodyLarge,),
                Text("本年度总工资",style: Theme.of(context).textTheme.titleSmall,)
              ],
            )
          ],
        ),
        )
      ],
    );


  }

}